#!/usr/bin/env python3.3

#
#  Filename: e57.py
#  Author  : lukas singer
#
#  Comment : Created by createSolution.sh
#

#import euler
#from euler import *

def pe57():
  n=3
  d=2
  c=0
  for i in range(1000):
    t=n
    n=n+2*d
    d=t+d
    if len(str(n))>len(str(d)):
      c+=1
  print(c)

if __name__=="__main__":
  pe57()

